﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Dune2013
{
    public class IrAlmacenarBehavior : Behavior
    {
        public IrAlmacenarBehavior() :
            base(){
                typeBehavior = TypeBehavior.IrA;
            }
        public override void execute(int dTime,Actor act)
        {

            base.execute(dTime,act);
            if (act.wayPoints.Count==0)
            act.changeBehavior(new AlmacenarBehavior(StaticStuff.velocidadAlmacenamientoPetroleo));

        }

        public override void enter(Actor act)
        {
            base.enter(act);
            Map mapa = Game1.getInstance().map;
            act.setWaypoints(Game1.getInstance().map.findPath((int)act.position.X / mapa.NODE_WIDTH, (int)act.position.Y / mapa.NODE_WIDTH, StaticStuff.baseX,StaticStuff.baseY,false));
        }

        public override void exit(Actor act)
        {
            base.exit(act);
        }
    }
}
